<template>
  <div>
    <el-form :model="student" label-width="120px" size="large">
      <el-row>
        <el-col :span="8">
          <el-form-item label="班主任">
            <el-input v-model="student.headTeacher" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="咨询师">
            <el-input v-model="student.linkman" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="报到时间">
            <el-date-picker v-model="student.registerDate" type="date" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item>
            是否需要领用电脑&nbsp;&nbsp;
            <el-switch v-model="student.pcRequired" active-text="是" inactive-text="否" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item>
            是否需要推荐就业&nbsp;&nbsp;
            <el-switch v-model="student.jobRecommended" active-text="是" inactive-text="否" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item>
            是否需要安排住宿&nbsp;&nbsp;
            <el-switch v-model="student.accommodationRequired" active-text="是" inactive-text="否" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="16">
          <el-form-item label="期望薪资(k)">
            <el-slider v-model="student.salaryArr" range :step="1000" :max="20000" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-button type="primary" @click="postOthers">提交</el-button>
    <form action="http://localhost:8080/lpp/uploads" method="post" enctype="multipart/form-data">
      <input type="file" name="uploadFiles" multiple>
      <input type="submit">
    </form>
  </div>

</template>

<script setup>
import { reactive, ref, getCurrentInstance, watch } from 'vue';

const student = reactive({
  linkman: '',
  headTeacher: '',
  registerDate: null,
  pcRequired: false,
  jobRecommended: false,
  accommodationRequired: false,
  idCardAttachment: '',
  graduationCertificationAttachment: '',
  salaryArr: [0, 0],
})


const { proxy } = getCurrentInstance()
const baseURL = "http://localhost:8080/"
const postOthers = function () {
  proxy.$axios.post(baseURL + '/student/others', student)
    .then(function (response) {
      const { data: res } = response
      console.log(res)
    });
}

</script>

<style scoped>

</style>